package com.zz.spring6.tx;

import com.zz.spring6.tx.controller.BookController;
import com.zz.spring6.tx.service.CheckoutService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

@SpringJUnitConfig(locations = "classpath:bean.xml")
public class TestBookTx {

//    @Autowired
//    private BookController bookController;

//    @Test
//    public void testBuyBook(){
//       // bookController.buyBook(1,1);
//    }

    @Autowired
    private CheckoutService checkoutService;
    @Test
    public void checkoutService(){
        Integer[] bookIds = {1,2};
        checkoutService.checkout(bookIds,1);
    }
}
